<?php
include 'bootstrap.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>


<meta name="Keywords" content="работы" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Distribution" content="Global" />
<meta name="Author" content="Bethrezen - admin@devgroup.ru" />
<meta name="Robots" content="index,follow" />

<link rel="stylesheet" href="<?=$F->getDirectoryName();?>/images/Underground.css" type="text/css" />			
<script type="text/javascript" src="<?=$F->getDirectoryName();?>/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="<?=$F->getDirectoryName();?>/js/jquery-ui-1.7.1.custom.min.js"></script>
<script type="text/javascript" src="<?=$F->getDirectoryName();?>/js/jquery.lightbox-0.5.pack.js"></script>
<link rel="stylesheet" type="text/css" href="<?=$F->getDirectoryName();?>/css/jquery.lightbox-0.5.css" media="screen" />

<title>Наши работы - Мой демо сайт</title>	

</head>

<body>
<!-- wrap starts here -->
<div id="wrap">

		<!-- header -->
		<div id="header">			
					
			<span id="slogan"> тестовый сайт</span>
			
			<!-- tabs -->
			<ul>
				<li id="current"><a href="<?=$F->getDirectoryName();?>/page/home.html"><span>Home</span></a></li>
				<li><a href="<?=$F->getDirectoryName();?>/works/archive.html"><span>Archives</span></a></li>
				<li><a href="<?=$F->getDirectoryName();?>/page/downloads.html"><span>Downloads</span></a></li>
				<li><a href="<?=$F->getDirectoryName();?>/faq.html"><span>FAQ</span></a></li>
				
			</ul>
											
		</div>
		
		<div id="header-logo">			
			
			<div id="logo">demo<span class="red">site</span></div>		
			
			<form method="post" class="search" action="#">
				<p><input name="search_query" class="textbox" type="text" />
  				<input name="search" class="searchbutton" value="Search" type="submit" /></p>
			</form>
						
		</div>
		

		<div id="sidebar" >							
			
			<h1>Sidebar Menu</h1>
			<div class="left-box">
				<ul class="sidemenu">
					<li><a href="<?=$F->getDirectoryName();?>/page/home.html">Home</a></li>
					<li><a href="<?=$F->getDirectoryName();?>/admin.php">AdminCP</a></li>
					<li><a href="<?=$F->getDirectoryName();?>/glossary.html">Словарь</a></li>
											
				</ul>	
			</div>
			
			<h1>Site Partners</h1>
			<div class="left-box">
				<ul class="sidemenu">
					<li><a href="http://www.bethrezen.ru">bethrezen.ru</a></li>
					 		
				</ul>	
			</div>
				
			
			<h1>Wise Words</h1>
			<div class="left-box">
				<p>&quot;Big men and big personalities make mistakes and admit them.
				 It is the little man who is afraid to admit he has been wrong&quot;</p>
				
				<p class="align-right">- Dr. Maxwell Maltz</p>
			</div>	
			
		
		</div>		
		
							
		<div id="main">	<h1>Наши работы</h1><BR>
<?php


if ($F->modules['works']->action == 'main')
	{
		// ***** Начало печати годов
		$years = $F->modules['works']->getYears();
		if (count($years)>0)
		{
			
			for ($i=0;$i<count($years);$i++)
				echo "<A href=\"".$F->modules['works']->makeYearUrl($years[$i]) . "\">{$years[$i]}</a> ";
			
			if (!isset($_GET['year']))
				$currentYear = intval($years[count($years)-1]);
			else
				$currentYear = intval($_GET['year']);
			
		// ***** Года напечатали!	Теперь беремся за список работ
		
			$items = $F->modules['works']->getTopWorksList($currentYear);
			foreach ($items as $item)
			{
				?>
<h2><?=$item['dateX'];?> | <?=$item['title']?></h2>
<?=$item['content'];?><Br style="clear:both;" />

<a href="<?=$F->modules['works']->makeShowUrl($item);?>">Подробнее</a>				
				<?php
			
			}
		}
	}
// Отображение работы
if  ($F->modules['works']->action == 'show')
	{
	
	// ***** Начало печати годов
		$years = $F->modules['works']->getYears();
		if (count($years)>0)
		{
			
			for ($i=0;$i<count($years);$i++)
				echo "<A href=\"".$F->modules['works']->makeYearUrl($years[$i]) . "\">{$years[$i]}</a> ";
			
			if (!isset($_GET['year']))
				$currentYear = intval($years[count($years)-1]);
			else
				$currentYear = intval($_GET['year']);
			
		}
		
	// ***** Года напечатали!
	
		if (isset($_GET['p']))
		{
			$item = $F->modules['works']->getWorks($_GET['p']);
			?>
<h2><?=$item['date'];?> | <?=$item['title'];?></h2> <!-- заголовок -->
<!--<blockquote><?=$item['content'];?></blockquote>--> <!-- краткое описание, думаю его тут не надо выводить -->
<?=$item['full'];?> <!-- полный текст новости -->
			<?
		}
	}
	?>
</div>
		
<!-- wrap ends here -->
</div>
		
<!-- footer starts here -->
<div class="footer">
	
		<p>	
		&copy; 2009 <strong>DevGroup</strong> &nbsp;&nbsp;	 
		Design by: <a href="http://www.styleshout.com/">styleshout</a> | 
		Valid <a href="http://validator.w3.org/check/referer">XHTML</a> |
   	<a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		
		</p>
		
</div>	
</body></html>